package com.oop.demo14;

public class Person {
    private String name;
    private int age;
    private int gender;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public String  getGender() {
        return gender == 0 ? "man":"woman";
    }
    public void work(){
        if (age >= 18 && age <=50){
            System.out.println(name +"可以参加工作");
        }
        else {
            System.out.println(name + "，你不能工作");
        }
    }
}
